$(function(){
    if($("#tyfzhsmc_id").val()){
        var tyfzhsmcId = $("#tyfzhsmc_id").val();
    }else{
        var tyfzhsmcId = $("#tyfzhsys_tyfzhsmc_id").combotree("getValue");
    }


    $("#tyfzhsys_tyfzhsmc_id").combotree({
        url:$.webPath() + '/cwgl/kmys/tyfzhsmc/get_tyfzhsmctreejson',
        onChange : function(){
            $("#tyfzhsys_fzhsmclx_id").combobox({
                url:$.webPath() + '/cwgl/kmys/tyfzhsmc/get_tyfzhsmcdl?mcId='+$("#tyfzhsys_tyfzhsmc_id").combotree("getValue"),
                onLoadSuccess : function(){
                    var data = $('#tyfzhsys_fzhsmclx_id').combobox('getData');
                    $("#tyfzhsys_fzhsmclx_id ").combobox('select',data[0].dl);
                }
            });
        },
        onLoadSuccess : function(){
            $("#tyfzhsys_fzhsmclx_id").combobox({
                url:$.webPath() + '/cwgl/kmys/tyfzhsmc/get_tyfzhsmcdl?mcId='+$("#tyfzhsys_tyfzhsmc_id").combotree("getValue"),
                onLoadSuccess : function(){
                    var data = $('#tyfzhsys_fzhsmclx_id').combobox('getData');
                    $("#tyfzhsys_fzhsmclx_id ").combobox('select',data[0].dl);
                }
            });
        }
    });


    $("#tyfzhsys_sjtyfzhsys_id").combotree({
        url:$.webPath() + '/cwgl/kmys/tyfzhsys/get_tyfzhsystreejson?tyfzhsmcId='+tyfzhsmcId
    });
});



